<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SimpleWindow: ItemsControl.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">SimpleWindow
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_items_control_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">ItemsControl.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="preprocessor">#include &quot;Control.h&quot;</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="keyword">namespace </span>sw</div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span>{</div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span>    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> TItem&gt;</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span>    <span class="keyword">class </span>ItemsControl; <span class="comment">// 向前声明</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span>    <span class="keyword">typedef</span> ItemsControl&lt;std::wstring&gt; StrItemsControl;</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span>    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> TItem&gt;</div>
<div class="foldopen" id="foldopen00019" data-start="{" data-end="};">
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html">   19</a></span>    <span class="keyword">class </span><a class="code hl_class" href="classsw_1_1_items_control.html">ItemsControl</a> : <span class="keyword">public</span> <a class="code hl_class" href="classsw_1_1_control.html">Control</a></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span>    {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span>    <span class="keyword">public</span>:</div>
<div class="foldopen" id="foldopen00025" data-start="{" data-end="};">
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html#a765b2e51cb5f439c464abbe031b0db09">   25</a></span>        <span class="keyword">const</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">ReadOnlyProperty&lt;int&gt;</a> <a class="code hl_variable" href="classsw_1_1_items_control.html#a765b2e51cb5f439c464abbe031b0db09">ItemsCount</a>{</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span>            <span class="comment">// get</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span>            [&amp;]() -&gt; <span class="keyword">const</span> <span class="keywordtype">int</span> &amp; {</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span>                <span class="keyword">static</span> <span class="keywordtype">int</span> result;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span>                result = this-&gt;<a class="code hl_function" href="classsw_1_1_items_control.html#a22321dbf927a5b508a3614e2565c76c2">GetItemsCount</a>();</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span>                <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span>            }};</div>
</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span> </div>
<div class="foldopen" id="foldopen00036" data-start="{" data-end="};">
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html#ae78a074093f7746f18c1ece3654fdcf6">   36</a></span>        <span class="keyword">const</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">Property&lt;int&gt;</a> <a class="code hl_variable" href="classsw_1_1_items_control.html#ae78a074093f7746f18c1ece3654fdcf6">SelectedIndex</a>{</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>            <span class="comment">// get</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>            [&amp;]() -&gt; <span class="keyword">const</span> <span class="keywordtype">int</span> &amp; {</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>                <span class="keyword">static</span> <span class="keywordtype">int</span> result;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>                result = this-&gt;<a class="code hl_function" href="classsw_1_1_items_control.html#ac8b269a4d6bd5b46f6f7026d5470b2c5">GetSelectedIndex</a>();</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>                <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>            },</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>            <span class="comment">// set</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>            [&amp;](<span class="keyword">const</span> <span class="keywordtype">int</span> &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">value</a>) {</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>                this-&gt;<a class="code hl_function" href="classsw_1_1_items_control.html#aa23a550b08ca55e7d1c412f462124527">SetSelectedIndex</a>(<a class="code hl_class" href="classsw_1_1_dictionary.html">value</a>);</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>            }};</div>
</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span> </div>
<div class="foldopen" id="foldopen00051" data-start="{" data-end="};">
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html#a81efc45fe838c47908e37e241614c672">   51</a></span>        <span class="keyword">const</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">ReadOnlyProperty&lt;TItem&gt;</a> <a class="code hl_variable" href="classsw_1_1_items_control.html#a81efc45fe838c47908e37e241614c672">SelectedItem</a>{</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>            <span class="comment">// get</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>            [&amp;]() -&gt; <span class="keyword">const</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">TItem</a> &amp; {</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span>                <span class="keyword">static</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">TItem</a> result;</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>                result = this-&gt;<a class="code hl_function" href="classsw_1_1_items_control.html#a8cbd0b52306bcf3cec2d96be0c6dd0ba">GetSelectedItem</a>();</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>                <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>            }};</div>
</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>    <span class="keyword">protected</span>:</div>
<div class="foldopen" id="foldopen00063" data-start="{" data-end="}">
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html#aaf5eb0f69c26b57da81fe8a22f962ec6">   63</a></span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classsw_1_1_items_control.html#aaf5eb0f69c26b57da81fe8a22f962ec6">OnSelectionChanged</a>()</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span>        {</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span>            this-&gt;<a class="code hl_function" href="classsw_1_1_u_i_element.html#a0635558e1928f1144566a30b884303aa">RaiseRoutedEvent</a>(ItemsControl_SelectionChanged);</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>        }</div>
</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span> </div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span>    <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html#a22321dbf927a5b508a3614e2565c76c2">   72</a></span>        <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code hl_function" href="classsw_1_1_items_control.html#a22321dbf927a5b508a3614e2565c76c2">GetItemsCount</a>() = 0;</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span> </div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html#ac8b269a4d6bd5b46f6f7026d5470b2c5">   77</a></span>        <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code hl_function" href="classsw_1_1_items_control.html#ac8b269a4d6bd5b46f6f7026d5470b2c5">GetSelectedIndex</a>() = 0;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span> </div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html#aa23a550b08ca55e7d1c412f462124527">   82</a></span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classsw_1_1_items_control.html#aa23a550b08ca55e7d1c412f462124527">SetSelectedIndex</a>(<span class="keywordtype">int</span> index) = 0;</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span> </div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html#a8cbd0b52306bcf3cec2d96be0c6dd0ba">   87</a></span>        <span class="keyword">virtual</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">TItem</a> <a class="code hl_function" href="classsw_1_1_items_control.html#a8cbd0b52306bcf3cec2d96be0c6dd0ba">GetSelectedItem</a>() = 0;</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span> </div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html#a36312564b15eb327474696bf407b7864">   93</a></span>        <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classsw_1_1_items_control.html#a36312564b15eb327474696bf407b7864">Clear</a>() = 0;</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span> </div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html#a34a19d40a81adc967b14e84689e8a7e4">   99</a></span>        <span class="keyword">virtual</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">TItem</a> <a class="code hl_function" href="classsw_1_1_items_control.html#a34a19d40a81adc967b14e84689e8a7e4">GetItemAt</a>(<span class="keywordtype">int</span> index) = 0;</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span> </div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html#a5fab112663e10fe37cf901fc6288bcff">  106</a></span>        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classsw_1_1_items_control.html#a5fab112663e10fe37cf901fc6288bcff">AddItem</a>(<span class="keyword">const</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">TItem</a> &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">item</a>) = 0;</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span> </div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html#ab4f053e3c099caf009fab48f7370ad96">  114</a></span>        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classsw_1_1_items_control.html#ab4f053e3c099caf009fab48f7370ad96">InsertItem</a>(<span class="keywordtype">int</span> index, <span class="keyword">const</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">TItem</a> &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">item</a>) = 0;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span> </div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html#af169d6e1cce32846f8d0043a69ab69b1">  122</a></span>        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classsw_1_1_items_control.html#af169d6e1cce32846f8d0043a69ab69b1">UpdateItem</a>(<span class="keywordtype">int</span> index, <span class="keyword">const</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">TItem</a> &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">newValue</a>) = 0;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span> </div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="classsw_1_1_items_control.html#a8ee8ced8a1134133fa7066ee4e29b7eb">  129</a></span>        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classsw_1_1_items_control.html#a8ee8ced8a1134133fa7066ee4e29b7eb">RemoveItemAt</a>(<span class="keywordtype">int</span> index) = 0;</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno">  130</span>    };</div>
</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span>}</div>
<div class="ttc" id="aclasssw_1_1_control_html"><div class="ttname"><a href="classsw_1_1_control.html">sw::Control</a></div><div class="ttdoc">控件</div><div class="ttdef"><b>Definition</b> Control.h:11</div></div>
<div class="ttc" id="aclasssw_1_1_dictionary_html"><div class="ttname"><a href="classsw_1_1_dictionary.html">sw::Dictionary</a></div><div class="ttdoc">字典类，内部维护了一个指向std::map的智能指针</div><div class="ttdef"><b>Definition</b> Dictionary.h:24</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html"><div class="ttname"><a href="classsw_1_1_items_control.html">sw::ItemsControl</a></div><div class="ttdoc">表示可用于呈现一组项的控件</div><div class="ttdef"><b>Definition</b> ItemsControl.h:20</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html_a22321dbf927a5b508a3614e2565c76c2"><div class="ttname"><a href="classsw_1_1_items_control.html#a22321dbf927a5b508a3614e2565c76c2">sw::ItemsControl::GetItemsCount</a></div><div class="ttdeci">virtual int GetItemsCount()=0</div><div class="ttdoc">获取子项数</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html_a34a19d40a81adc967b14e84689e8a7e4"><div class="ttname"><a href="classsw_1_1_items_control.html#a34a19d40a81adc967b14e84689e8a7e4">sw::ItemsControl::GetItemAt</a></div><div class="ttdeci">virtual TItem GetItemAt(int index)=0</div><div class="ttdoc">获取指定索引处子项的值</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html_a36312564b15eb327474696bf407b7864"><div class="ttname"><a href="classsw_1_1_items_control.html#a36312564b15eb327474696bf407b7864">sw::ItemsControl::Clear</a></div><div class="ttdeci">virtual void Clear()=0</div><div class="ttdoc">清空所有子项</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html_a5fab112663e10fe37cf901fc6288bcff"><div class="ttname"><a href="classsw_1_1_items_control.html#a5fab112663e10fe37cf901fc6288bcff">sw::ItemsControl::AddItem</a></div><div class="ttdeci">virtual bool AddItem(const TItem &amp;item)=0</div><div class="ttdoc">添加新的子项</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html_a765b2e51cb5f439c464abbe031b0db09"><div class="ttname"><a href="classsw_1_1_items_control.html#a765b2e51cb5f439c464abbe031b0db09">sw::ItemsControl::ItemsCount</a></div><div class="ttdeci">const ReadOnlyProperty&lt; int &gt; ItemsCount</div><div class="ttdoc">项数</div><div class="ttdef"><b>Definition</b> ItemsControl.h:25</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html_a81efc45fe838c47908e37e241614c672"><div class="ttname"><a href="classsw_1_1_items_control.html#a81efc45fe838c47908e37e241614c672">sw::ItemsControl::SelectedItem</a></div><div class="ttdeci">const ReadOnlyProperty&lt; TItem &gt; SelectedItem</div><div class="ttdoc">选中项</div><div class="ttdef"><b>Definition</b> ItemsControl.h:51</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html_a8cbd0b52306bcf3cec2d96be0c6dd0ba"><div class="ttname"><a href="classsw_1_1_items_control.html#a8cbd0b52306bcf3cec2d96be0c6dd0ba">sw::ItemsControl::GetSelectedItem</a></div><div class="ttdeci">virtual TItem GetSelectedItem()=0</div><div class="ttdoc">获取选中项</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html_a8ee8ced8a1134133fa7066ee4e29b7eb"><div class="ttname"><a href="classsw_1_1_items_control.html#a8ee8ced8a1134133fa7066ee4e29b7eb">sw::ItemsControl::RemoveItemAt</a></div><div class="ttdeci">virtual bool RemoveItemAt(int index)=0</div><div class="ttdoc">移除指定索引处的子项</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html_aa23a550b08ca55e7d1c412f462124527"><div class="ttname"><a href="classsw_1_1_items_control.html#aa23a550b08ca55e7d1c412f462124527">sw::ItemsControl::SetSelectedIndex</a></div><div class="ttdeci">virtual void SetSelectedIndex(int index)=0</div><div class="ttdoc">设置选中项索引</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html_aaf5eb0f69c26b57da81fe8a22f962ec6"><div class="ttname"><a href="classsw_1_1_items_control.html#aaf5eb0f69c26b57da81fe8a22f962ec6">sw::ItemsControl::OnSelectionChanged</a></div><div class="ttdeci">virtual void OnSelectionChanged()</div><div class="ttdoc">选中项改变时调用该函数</div><div class="ttdef"><b>Definition</b> ItemsControl.h:63</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html_ab4f053e3c099caf009fab48f7370ad96"><div class="ttname"><a href="classsw_1_1_items_control.html#ab4f053e3c099caf009fab48f7370ad96">sw::ItemsControl::InsertItem</a></div><div class="ttdeci">virtual bool InsertItem(int index, const TItem &amp;item)=0</div><div class="ttdoc">添加子项到指定索引</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html_ac8b269a4d6bd5b46f6f7026d5470b2c5"><div class="ttname"><a href="classsw_1_1_items_control.html#ac8b269a4d6bd5b46f6f7026d5470b2c5">sw::ItemsControl::GetSelectedIndex</a></div><div class="ttdeci">virtual int GetSelectedIndex()=0</div><div class="ttdoc">选中项的索引，当无选中项时为-1</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html_ae78a074093f7746f18c1ece3654fdcf6"><div class="ttname"><a href="classsw_1_1_items_control.html#ae78a074093f7746f18c1ece3654fdcf6">sw::ItemsControl::SelectedIndex</a></div><div class="ttdeci">const Property&lt; int &gt; SelectedIndex</div><div class="ttdoc">选中项的索引，当无选中项时为-1</div><div class="ttdef"><b>Definition</b> ItemsControl.h:36</div></div>
<div class="ttc" id="aclasssw_1_1_items_control_html_af169d6e1cce32846f8d0043a69ab69b1"><div class="ttname"><a href="classsw_1_1_items_control.html#af169d6e1cce32846f8d0043a69ab69b1">sw::ItemsControl::UpdateItem</a></div><div class="ttdeci">virtual bool UpdateItem(int index, const TItem &amp;newValue)=0</div><div class="ttdoc">更新指定位置的子项</div></div>
<div class="ttc" id="aclasssw_1_1_u_i_element_html_a0635558e1928f1144566a30b884303aa"><div class="ttname"><a href="classsw_1_1_u_i_element.html#a0635558e1928f1144566a30b884303aa">sw::UIElement::RaiseRoutedEvent</a></div><div class="ttdeci">void RaiseRoutedEvent(RoutedEventType eventType)</div><div class="ttdoc">触发路由事件</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_01fcd3835fb4e7d9331b722d86291b65.html">sw</a></li><li class="navelem"><a class="el" href="dir_ed5f6ece24ffcc4307a76d27c2494db3.html">inc</a></li><li class="navelem"><b>ItemsControl.h</b></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0 </li>
  </ul>
</div>
</body>
</html>
